{include file="index_header" }

<ol class="breadcrumb">
    <li><a href="#">首页</a></li>
    <li><a href="#">商品</a></li>
    <li class="active">分类管理</li>
</ol>


<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">
            <a href="/admin/goods_class/edit" class="btn btn-default">新增数据</a>
        </h3>
    </div>
    <div class="table-responsive">
        <table class="table">
            <thead>
            <tr>
                <th>操作</th>
                <th>排序</th>
                <th>分类名称</th>
                <th>商品展示</th>
            </tr>
            </thead>
            <tbody>
            {foreach $goods_class as $item}
            <tr>
                <td>
                    <button type="button" class="btn btn-default goods_class_del" id="{$item.gc_id}">删除</button>
                    <button type="button" class="btn btn-default">设置</button>
                </td>
                <td>{$item.gc_sort}</td>
                <td>{$item.gc_name}</td>
                <td>{$item.show_type=='1'?'颜色':'SPU'}</td>
            </tr>
            {/foreach}

            </tbody>
        </table>
    </div>
</div>

<script type="text/javascript">
    $(document).ready(function(){
        $('.goods_class_del').click(function(){
            $.post('/admin/goods_class/delete',{id:this.id},function(info){
                if(info.code = 1){
                    alert(info.msg);
                    location.reload();
                }else{
                    alert(info.msg);
                }
            })
        });
    });
</script>

{include file="index_footer" }